//
//  HapticsManager.swift
//  TodoList
//
//  Created by 刘圣洁 on 2025/6/13.
//

import UIKit

class HapticsManager {
    static let instance = HapticsManager()
    private init() {}
    
    func notification(type: UINotificationFeedbackGenerator.FeedbackType) {
        let gennrator = UINotificationFeedbackGenerator()
        gennrator.notificationOccurred(type)
    }
    
    func impact(style: UIImpactFeedbackGenerator.FeedbackStyle) {
        let generator = UIImpactFeedbackGenerator(style: style)
        generator.impactOccurred()
    }
}

//Button("success") { HapticsManager.instance.notification(type: .success) }
//Button("warning") { HapticsManager.instance.notification(type: .warning) }
//Button("error") { HapticsManager.instance.notification(type: .error) }
//Divider()
//Button("soft") { HapticsManager.instance.impact(style: .soft) }
//Button("light") { HapticsManager.instance.impact(style: .light) }
//Button("medium") { HapticsManager.instance.impact(style: .medium) }
//Button("rigid") { HapticsManager.instance.impact(style: .rigid) }
//Button("heavy") { HapticsManager.instance.impact(style: .heavy) }
